package cn.itcast.hotel.controller;

import cn.itcast.hotel.dto.RequestParams;
import cn.itcast.hotel.service.IHotelService;
import cn.itcast.hotel.vo.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @Description HotelController
 * @Author liuqiang
 * @Date 2024/3/22
 */
@RestController
public class HotelController {

    @Autowired
    private IHotelService hotelService;

    /**
     * 分页条件查询
     * @param params
     * @return
     */
    @PostMapping("/hotel/list")
    public PageResult pageList(@RequestBody RequestParams params) throws IOException {
        PageResult result = hotelService.pageList(params);
        return result;
    }
}
